//
//  UIView+TestSwizzle.m
//  UIViewLifeCycleTest
//
//  Created by anchor on 2017/7/14.
//  Copyright © 2017年 QDHome. All rights reserved.
//

#import "UIView+TestSwizzle.h"
#import "NSObject+Swizzle.h"

@implementation UIView (TestSwizzle)

//- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
//- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;

//- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
//- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;
//
//- (void)bringSubviewToFront:(UIView *)view;
//- (void)sendSubviewToBack:(UIView *)view;

+ (void)load
{
//    [UIView imy_swizzleMethod:@selector(layoutSubviews) withMethod:@selector(test_layoutSubviews) error:nil];
//    [UIView imy_swizzleMethod:@selector(addSubview:) withMethod:@selector(test_addSubview:) error:nil];
//    [UIView imy_swizzleMethod:@selector(removeFromSuperview) withMethod:@selector(test_removeFromSuperview) error:nil];
//    [UIView imy_swizzleMethod:@selector(didAddSubview:) withMethod:@selector(test_didAddSubview:) error:nil];
//    [UIView imy_swizzleMethod:@selector(willRemoveSubview:) withMethod:@selector(test_willRemoveSubview:) error:nil];
//    [UIView imy_swizzleMethod:@selector(willMoveToSuperview:) withMethod:@selector(test_willMoveToSuperview:) error:nil];
     [UIView imy_swizzleMethod:@selector(didMoveToSuperview) withMethod:@selector(test_didMoveToSuperview) error:nil];
//   [UIView imy_swizzleMethod:@selector(willMoveToWindow:) withMethod:@selector(test_willMoveToWindow:) error:nil];
    [UIView imy_swizzleMethod:@selector(didMoveToWindow) withMethod:@selector(test_didMoveToWindow) error:nil];
//       [UIView imy_swizzleMethod:@selector(drawRect:) withMethod:@selector(test_drawRect:) error:nil];
}

//- (BOOL)test_isDescendantOfView:(UIView *)view
//{
//     NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//    return [self test_isDescendantOfView:view];
//}
//
//- (void)test_layoutSubviews{
//    [self test_layoutSubviews];
//   NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}
//
//- (void)test_addSubview:(UIView *)view
//{
//    [self test_addSubview:view];
//    NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}
//
//- (void)test_removeFromSuperview
//{
//    [self test_removeFromSuperview];
//      NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}
//
//- (void)test_didAddSubview:(UIView *)subview{
//    [self test_didAddSubview:subview];
//      NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}
//
//- (void)test_willRemoveSubview:(UIView *)subview{
//    [self test_willRemoveSubview:subview];
//     NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}
//
//- (void)test_willMoveToSuperview:(nullable UIView *)newSuperview{
//    [self test_willMoveToSuperview:newSuperview];
//     NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}

- (void)test_didMoveToSuperview{
    [self test_didMoveToSuperview];
      NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
}

//- (void)test_willMoveToWindow:(nullable UIWindow *)newWindow{
//    [self test_willMoveToWindow:newWindow];
//      NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}

- (void)test_didMoveToWindow{
    [self test_didMoveToWindow];
      NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
}

//- (void)test_drawRect:(CGRect)rect
//{
//    [self test_drawRect:rect];
//    NSLog(@"%@=>%@",self,NSStringFromSelector(_cmd));
//}

@end
